﻿FlyTalk.views.ColumnView = Ext.extend(Ext.Panel, {

	scroll: true,
	title: 'column',
    initComponent: function (options) {

    	
		// list
		this.MixedStore = new Ext.data.JsonStore({
			model : 'MixedPostModel',
		});
		
		this.tweetList = new Ext.List({
			fullscreen: true,
			scroll: true,
			emptyText: '<div style="margin:5px;">No tweets cached.</div>',
			itemTpl : [ 
                   '<div id="touchpoint_container_{type}_{answered}">',
                        '<tpl for=".">',
                            '<div class="touchpoint_data">',
                            '<div class="touchpoint_icon">',
                                '<img width="30" height="30" src="{image_url}"/>',
                            '</div>',
                            '<div class="touchpoint_content_{type}">',
                                '<h3 class="touchpoint">{from_user} <span class="type">{type}</span></h3>',
                                '<p>{text}</p> <div class="tweet-details">{date} {followed} </div>',
                            '</div>',
                            '<div class="clear"></div>',
                            '</div>',
                        '</tpl>',
                    '</div>'
			],
			grouped : false,
			indexBar: false,
		//	onItemDisclosure: true,
			store: this.MixedStore,
			
			
			listeners:{
				itemTap: function(dv, index, tweet, evt){
					FlyTalk.views.ColumnView.onMenu(index);
				},
			},
		});
	
		this.items = [this.tweetList];
		
		FlyTalk.views.ColumnView.superclass.initComponent.call(this);
    },
    
    onMenu: function (ind) {
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openMenu',
           // post: record,
            index: ind,
        });
    },
    
});